import React from 'react'
import classnames from 'classnames'
import styles from './index.module.scss'
const TextArea = ({ className, value, onChange, maxLength, style }) => {
  return (
    <div className={classnames(styles.root, className)} style={style}>
      {/* 文本输入框 */}
      <textarea
        className='textarea'
        value={value}
        maxLength={maxLength}
        onChange={onChange}
      />

      {/* 当前字数/最大允许字数 */}
      <div className='count'>
        {value.length}/{maxLength}
      </div>
    </div>
  )
}

export default TextArea
